import request from '@/utils/request';

// 转换额度申请
export function InfoNoBusinessRele(calcSchemeId) {
	return request({
		url: `/quota/quotaCalcScheme/infoNoBusinessRele/${calcSchemeId}`,
		method: 'get',
		params: {},
	});
}
// 应付单列表
export function Details(id) {
	return request({
		url: `/quota/quotaCalcScheme/info/${id}`,
		method: 'get',
	});
}

// 获取当前用户可使用的产品方案列表
export function AuthorizedProductSchemes(data) {
	return request({
		url: `/quoter/scheme/common/getAuthorizedProductSchemes`,
		method: 'post',
		data,
	});
}

// 额度测算提交
export function Save(data) {
	return request({
		url: `/quota/quotaCalcScheme/applySubmit`,
		method: 'post',
		data,
	});
}
// 暂存
export function DraftSave(data) {
	return request({
		url: `/quota/quotaCalcScheme/applyDraftSave`,
		method: 'post',
		data,
	});
}

export function Insurance(params) {
	return request({
		url: `/quoter/insurance/item-list`,
		method: 'get',
		params,
	});
}

export function Decoration(params) {
	return request({
		url: `/quoter/decoration/item-list`,
		method: 'get',
		params,
	});
}

// 租金预览表
export function RentPaymentPreview(params) {
	return request({
		url: `/finance/rentPaymentPreview/list`,
		method: 'post',
		data: params,
	});
}

// 转换额度申请
export function InfoCopy(calcSchemeId) {
	return request({
		url: `/quota/quotaCalcScheme/infoCopy/${calcSchemeId}`,
		method: 'get',
		params: {},
	});
}

// 获取报价替代车列表
export function LevelList(params) {
	return request({
		url: `/quoter/alternative-car/level/list`,
		method: 'get',
		params,
	});
}

// 获取报价替代车列表
export function PackagelList(params) {
	return request({
		url: `/quoter/maintenance-package/list`,
		method: 'get',
		params,
	});
}
// 查询供应商列表
export function SupplierlList(params) {
	return request({
		url: `/supplier/supplier/allList`,
		method: 'get',
		params,
	});
}

// 根据车辆id 查询三年内出险次数
export function CarCount(carId) {
	return request({
		url: `/car/carMaintenance/outDanger/${carId}`,
		method: 'get',
	});
}

// 获取组织列表
export function DeptList(query) {
	return request({
		url: '/system/dept/list',
		method: 'get',
		params: query,
	});
}

// 测算
export function Calc(params) {
	return request({
		url: `/quoter/calc`,
		method: 'post',
		data: params,
	});
}

// 其他生效模板
export function otherOptionalTemplates(query) {
	return request({
		url: '/contractTemplate/contractTemplate/optionalTemplates',
		method: 'get',
		params: query,
	});
}
export function List(query) {
	return request({
		url: '/quota/quotaCalcScheme/list',
		method: 'get',
		params: query,
	});
}
export function Remove(calcSchemeId) {
	return request({
		url: `/quota/quotaCalcScheme/remove/${calcSchemeId}`,
		method: 'delete',
	});
}
export function SinglePlan(id) {
	return request({
		url: `/quoter/scheme/common/${id}`,
		method: 'post',
	});
}
export function LastInsuranceMoney(params) {
	return request({
		url: `/car/insurance/recordList`,
		method: 'get',
		params,
	});
}
